package com.ruoyi.system.domain.enums;

import lombok.Getter;

@Getter
public enum PackageTypeEnum {
    APP(1, "应用"),
    DATA_PACKAGE(2, "数据包");

    private final Integer code;
    private final String name;

    PackageTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(Integer code) {
        if (code == null) return "未知类型";
        for (PackageTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value.getName();
            }
        }
        return "未知类型";
    }
}